class Solution {
public:
    vector<vector<int>> ret;
    vector<int> path;

    void dfs(vector<int>& nums, int pos)
    {
        if (path.size() >= 2) {
            ret.push_back(path);
        }
        unordered_set<int> s;
        for (int i = pos; i < nums.size(); i++)
        {
            if (!path.empty() && path.back() > nums[i] || s.count(nums[i])) continue;
            s.insert(nums[i]);
            path.push_back(nums[i]);
            dfs(nums, i + 1);
            path.pop_back();
        }
    }
    vector<vector<int>> findSubsequences(vector<int>& nums) {
        dfs(nums, 0);
        return ret;
    }
};
class Solution {
public:
    int climbStairs(int n) {
        int ret = 0;
        vector<int> dp(n + 1);
        dp[0] = dp[1] = 1;
        for (int i = 2; i <= n; i++)
            dp[i] = dp[i - 1] + dp[i - 2];
        return dp[n];
    }
};